home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1599 / 1433 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  8.1 KB

  1. Date: Sun, 22 May 94 23:10 CDT
  2. From: ekl@sdf.lonestar.org (Evan K. Langlois)
  3. To: mint@atari.archive.umich.edu
  4. Subject: Domain X
  5.  
  6.  
  7. I'll start calling this Domain X (as in Uni_X_ or _X_Windows) for teh sake
  8. of brevity.
  9.  
  10. ========================================================================
  11. > I hope my intensions about the new domain are more clear.
  12.  You should post the lastest summary to the list. :-)
  13.  Or better: You should start implementing it! ::--))
  14. ========================================================================
  15.  
  16. This is part summary, part reply.  I can't implement it because, well, 
  17. there are a number of problems.  1 - my compiler is broke for now. 2 -
  18. the cookiejar calls are required, and I haven't finished those because
  19. my compiler is broke (hey! what's a good gemdos opcode for a Cookiejar
  20. call?  I may also need 2 or 3 more opcodes for reading the system tick
  21. without being in super-visor mode and manipulating the shell pointer as
  22. I've always like the idea of having 1 shell for all programs to use
  23. and being able to execute command lines through the shell using _shell_p)
  24. Maybe a key-click/system bell control call, since it seems you need to
  25. mess with supervisor memory to set these too.  MiNT can provide the
  26. needed protection for these calls while making Super() practically useless.
  27.  
  28. Implementation can begin in the path2cookie() function.  The recent change
  29. to return EPTHNF instead of EFILNF could be removed for Domain X apps.
  30. Just test the domain before returning a value I guess.  Where else there
  31. may be conflicts between domains is over my head.  I don't know enough about
  32. unix, which is why i'm not the choice to implement Domain X (this is the
  33. 3rd reason, if your counting).
  34.  
  35. ========================================================================
  36.  This would result in either MiNT starting with the new domain as a default
  37. plus a setuid program to switch "back" to GEM after some security checks are
  38. done, because you'll then be able to start up secure as default. Or MiNT would
  39. start as normal and you'll have to fix startup programs like 'init' or at
  40. least 'getty' to switch to secure domain later.
  41. ========================================================================
  42.  
  43. Uhh .. second way.  Having MiNT start up pid 001 (or worse, pid 000) as 
  44. domain X would really make things difficult.  It's MUCH easier to just have
  45. init (or your shell programs!) switch to domain X.  MultiTOS users would
  46. certainly prefer it that way.
  47.  
  48. ========================================================================
  49. > No, I don't agree here at all. (...) Since only the super-user can switch
  50. > from the new domain to TOS or MiNT and only a TOS or MiNT domain process
  51. > can access GEM, and then only if you are effectively root. I think that
  52. > is fairly secure.
  53.  
  54.  Ok, I think I've got your point.
  55.  
  56. > 1) No GEM programs should be allowed under this new mode.
  57. >
  58. > Agreed.
  59.  
  60.  Or do you have an idea to make fork() work with a pure 68000 system?
  61. ========================================================================
  62.  
  63. Actually, I do have a few ideas.  Since tfork() works, then Pvfork() could
  64. be hacked up to be non-blocking.  Users of Pvfork() would have to realize
  65. that ALL memory is shared, and all memory is owned by the PARENT application.
  66. The user could use semaphores when necessary to protect access to sensitive
  67. data.  This would be very useful.  Just set up the new process much like
  68. tfork() would.
  69.  
  70. Unblocking Pfork() seems to be a problem of pointers.  A pointer in the parent
  71. when copied to the child will access the paren't memory, not the child's
  72. memory.  I think that if the code is base-relative, then you can adjust the 
  73. base register of the child to take care of 90% of the programs data access.
  74. The rest is what to do with pointers that are "computed", or returned from
  75. a malloc.  One idea is to use the memory "handle" system that DMJ is working
  76. on (although he isn't going to do it for MiNT, he doing it for TOS/Geneva).
  77. Basically, a new call allows you to allocate a block of memory, but instead of
  78. a pointer to the block, you get a "handle".  To access the block, you must
  79. "lock" it in place - this call returns a pointer.  When you are done, you 
  80. release the lock, and your pointer becomes invalid, as the manager can now
  81. move the block, defragment memory, or swap it to disk.  Your "handle" is now
  82. the only way to access the block .. again re-locking it and getting a new
  83. pointer.  Such a system could help in managing pointers when forking a child.
  84. It would also be useful in a shared memory file, since you can put handles
  85. in the shared block, but not pointers.  It STILL may not be possible to
  86. reliably use Pfork() on a 68000.  However, Pvfork() doesn't even need to
  87. copy data, except maybe a copy of what is on the stack, and a new executable
  88. format that manages stack could help here.
  89.  
  90. ========================================================================
  91.  Most of the security aspects are ridiculous if the stuff runs on a pure
  92. 68000 machine because you can almost do what you want anyways.
  93. ========================================================================
  94.  
  95. Only if you allow them to upload programs, or to access your compiler.
  96. On a 68K, anyone would be a fool to let a remote user run GCC as you
  97. just don't have the resources available for that.  Anyone that allows
  98. the remote user to upload a program for a 68K would have to either trust
  99. the user (how many users know how to get the 68K into supervisor mode without
  100. the Super() call anyway?).  Likely, they still wouldn't do too much damage
  101. since Super() will fail.  
  102.  
  103. ========================================================================
  104. > [GEM behaving bad]
  105.  
  106.  If you silently accept to force these users to buy the newest MultiTOS in
  107. order to be able to do something serious, you can also say: Go and get the
  108. newest hardware, otherwise you won't be able to something serious at all.
  109. ========================================================================
  110.  
  111. I don't understand.  MultiTOS or the ROM GEM can run.  GEM programs run
  112. in MiNT or TOS domain (providing you are the super-user or are at the local
  113. console, depending on how you want to protect things).  I'm NOt saying people
  114. should buy MultiTOS as Domain X shouldn't allow GEM programs anyway.
  115.  
  116. Protecting acess to XBIOS/BIOS/AES/VDI traps could be done by pointing
  117. these traps into an internal MiNT routine when a program is run.  The first
  118. call the program makes goes into MiNT.  If MiNT decides this program can
  119. make the call legally, it simply assigns the pointer of the real trap routines
  120. into that applications handler and falls through it.  This program can then
  121. make more calls to that trap directly without going through MiNTs checking.
  122. A child process has its traps again pointed into MiNT until a call is made.
  123. This should allow maximum protection and only the first call to a particular
  124. trap (such as the AES/VDI trap) to slow down.  Also, if no GEM has been
  125. installed, you can signal the program with an invalid function signal, and
  126. if the program should not access the trap, you either kill it, return EACCDN
  127. or send it some other signal.
  128.  
  129. ========================================================================
  130.  That *could* lead to the opinion that a new mode should perhaps be restricted
  131. to a real 68030. You could then happily define the fork() stuff to only work
  132. in the new mode and discard it from the old modes. Very old software doesn't
  133. use it anyways, and the newer one can easily be recompiled.
  134. ========================================================================
  135.  
  136. I've thought about this as well.  And I'm curious what everyone else thinks
  137. about leaving this Unix-like domain to the 030s only.  Personally, I'd rather
  138. not since I don't have an 030, but then again, I'm not the person that would
  139. benefit much from the Unix domain anyway!!
  140.  
  141. ========================================================================
  142. > [new Malloc strategy]
  143. > Only new programs would use it.  Others would use fixed memory as normal.
  144. > So it could work without killing other programs.
  145. ========================================================================
  146.  
  147. I'm currently discussing this memory handle stuff with DMJ to see if there
  148. is a possibility of emulating some of the function of an MMU in software
  149. using this semaphore block-locking stuff.
  150.  
  151.  
  152.